package com.igoal.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.igoal.dao.CommentEntryDAO;
import com.igoal.dao.UserDAOExt;
import com.igoal.dao.UserGoalEntryDAO;
import com.igoal.dto.CommentEntryDTO;
import com.igoal.entity.CommentEntry;
import com.igoal.entity.UserGoalEntry;
import com.igoal.entity.factory.EntityFactory;

@Service("commentEntryService")
public class CommentEntryServiceImpl
		extends BaseCommentEntryService<UserGoalEntry, CommentEntry, CommentEntryDTO>
		implements CommentEntryService<UserGoalEntry, CommentEntry, CommentEntryDTO> {
	@Autowired	
	public void setUserDAO(UserDAOExt userDAO) {
		this.userDAO = userDAO;		
	}
	
	@Autowired
	public void setCommentEntryDAO(CommentEntryDAO commentEntryDAO) {
		this.commentDAO = commentEntryDAO;
	}
	
	@Autowired
	public void setActionLoggerService(ActionLoggerService actionLoggerService) {
		this.actionLoggerService = actionLoggerService;
	}
	
	@Autowired
	public void setUserGoalEntryDAO(UserGoalEntryDAO entryDAO){
		this.entryDAO = entryDAO;
	}

	@Override
	public CommentEntryDTO initDTO() {
		CommentEntryDTO dto = new CommentEntryDTO();		
		return dto;
	}

	@Override
	public CommentEntry initEntity() {
		CommentEntry comment = new CommentEntry();
		EntityFactory.setAuditInformation(comment);
		return comment;
	}
}
